const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const userSchema = new Schema({
    userId: {
        type: String,
        require: true,
        unique: true
    },
    phoneNumber: {
        type: String,
        require: true,
        unique: true
    },
    avator: {
        type: String,
        default: 'https://pic2.zhimg.com/v2-6f70cbd935436b5cd6679dcc0599d2fa_r.jpg?source=1940ef5c'
    },
    nickName: {
        type: String,
        default: '用户'
    },
    birthDay: {
        type: String,
        default: '2000-01-01'
    },
    age: {
        type: Number,
        default: 18,

    },
    
    location: {
        type: String,
        default: ''
    },
    gender: {
        type: String,
        default: ''
    },
    currentLocation: {
        type: String,
        default: ''
    },

},
    {
        collection: 'user', versionKey: false
    })

module.exports = mongoose.model('User', userSchema)